#include <bits/stdc++.h>
//I hate CCF!
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
int r[114514],cn[114514];
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    int n;cin>>n;
    for(int i=1;i<=n;i++){
        cin>>r[i];
    }
    int las=0,ge=0;
    sort(r+1,r+n+1);
    for(int i=1;i<=n;i++){
        cn[r[i]]++;
    }ge=r[1];
    for(int i=1;i<=100000;i++){
        if(!cn[i])continue;
        if(i==ge){
            las+=cn[i];
            continue;
        }
        las=las-cn[i];
        if(las<0)las=0;
        las+=cn[i];
    }
    cout<<las<<endl;
    return 0;
}
